#!/bin/bash


if [ "$1" == "start" ];then
	nohup redis-browser -C ${install_dir}/${server_dir}/config.yml  -U redis://${one} -B ${listen} -P ${port} >> ${log_dir}/${server_dir}/redis-browser.log &
elif [ "$1" == "stop" ];then
	pid=`netstat -unltp | grep ":${port}" | awk  '{print $7}' | awk -F'/' '{print $1}'`
	kill -9 $pid
elif [ "$1" == "status" ];then
    netstat -unltp | grep :${port} &> /dev/null
    [ $? -eq 0 ] && echo "redis-browser ok" || echo "redis-browser error"
else
	echo "start | stop | status"
fi
